package org.webflux.consumer.service;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.webflux.consumer.pojo.User;
import org.webflux.remote.client.annotation.FeignWebFlux;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@FeignWebFlux(url="http://localhost:8005/users")
public interface UserFeignWebFlux {

    @GetMapping("/all")
    Flux<User> findAll();

    @GetMapping("/{id}")
    Mono<User> findById(@PathVariable("id") String id);

    @PostMapping("/add")
    Mono<String> createUser(@RequestBody User user);



}
